package cc.rengu.igas.bomp.biz.service.impl;

import cc.rengu.igas.bomp.common.enums.RespCodeEnum;
import cc.rengu.igas.bomp.facade.BompMchntQueryService;
import cc.rengu.igas.bomp.facade.request.*;
import cc.rengu.igas.bomp.facade.response.*;
import cc.rengu.igas.bomp.facade.result.Result;
import cc.rengu.oltp.service.model.BizException;
import cc.rengu.oltp.service.model.DubboResult;
import cc.rengu.oltp.service.realize.DubboService;
import cc.rengu.oltp.service.realize.impl.DubboServiceImpl;
import cc.rengu.utility.log.RgLog;
import cc.rengu.utility.log.RgLogger;
import com.alibaba.fastjson.JSONObject;

import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;

public class BompMchntQueryServiceImpl implements BompMchntQueryService {

    private final RgLogger rglog = RgLog.getLogger(this.getClass().getName());

    @Override
    public Result<MchntInfoListQueryResponse> mchntInfoListQuery(MchntInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntInfoListQueryResponse> result = new Result<>();
        MchntInfoListQueryResponse response = new MchntInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntInfoListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntBaseInfoQueryResponse> mchntBaseInfoQuery(MchntBaseInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntBaseInfoQueryResponse> result = new Result<>();
        MchntBaseInfoQueryResponse mchntBaseInfoQueryResponse = new MchntBaseInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntBaseInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            mchntBaseInfoQueryResponse = (MchntBaseInfoQueryResponse) dubboResult.getResult();
            result.setResult(mchntBaseInfoQueryResponse);
            mchntBaseInfoQueryResponse.setRespCode(dubboResult.getRespCode());
            mchntBaseInfoQueryResponse.setRespDesc(dubboResult.getRespDesc());
            result.setResult(mchntBaseInfoQueryResponse);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户基本信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                mchntBaseInfoQueryResponse.setRespCode(((BizException) e).getCode());
                mchntBaseInfoQueryResponse.setRespDesc(e.getMessage());
            } else {
                mchntBaseInfoQueryResponse.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                mchntBaseInfoQueryResponse.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(mchntBaseInfoQueryResponse);
        }
        return result;
    }

    @Override
    public Result<MchntSignInfoQueryResponse> mchntSignInfoQuery(MchntSignInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntSignInfoQueryResponse> result = new Result<>();
        MchntSignInfoQueryResponse mchntSignInfoQueryResponse = new MchntSignInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntSignInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            mchntSignInfoQueryResponse = (MchntSignInfoQueryResponse) dubboResult.getResult();
            result.setResult(mchntSignInfoQueryResponse);
            mchntSignInfoQueryResponse.setRespCode(dubboResult.getRespCode());
            mchntSignInfoQueryResponse.setRespDesc(dubboResult.getRespDesc());
            result.setResult(mchntSignInfoQueryResponse);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户签约信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                mchntSignInfoQueryResponse.setRespCode(((BizException) e).getCode());
                mchntSignInfoQueryResponse.setRespDesc(e.getMessage());
            } else {
                mchntSignInfoQueryResponse.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                mchntSignInfoQueryResponse.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(mchntSignInfoQueryResponse);
        }
        return result;
    }

    @Override
    public Result<MchntSettleAcctInfoQueryResponse> mchntSettleInfoQuery(MchntSettleAcctInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntSettleAcctInfoQueryResponse> result = new Result<>();
        MchntSettleAcctInfoQueryResponse response = new MchntSettleAcctInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntSettleAcctInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntSettleAcctInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户结算账户信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntProdListQueryResponse> mchntProdListQuery(MchntProdListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntProdListQueryResponse> result = new Result<>();
        MchntProdListQueryResponse response = new MchntProdListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntProdListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntProdListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户产品列表信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntProdInfoQueryResponse> mchntProdInfoQuery(MchntProdInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntProdInfoQueryResponse> result = new Result<>();
        MchntProdInfoQueryResponse response = new MchntProdInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntProdInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntProdInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户产品信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntImageInfoQueryResponse> mchntImageInfoQuery(MchntImageInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntImageInfoQueryResponse> result = new Result<>();
        MchntImageInfoQueryResponse response = new MchntImageInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntImageInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntImageInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户映像信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<AgentMchntListQueryResponse> agentMchntListQuery(AgentMchntListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<AgentMchntListQueryResponse> result = new Result<>();
        AgentMchntListQueryResponse response = new AgentMchntListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, AgentMchntListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (AgentMchntListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("代理机构列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<PlatMchntListQueryResponse> platMchntListQuery(PlatMchntListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<PlatMchntListQueryResponse> result = new Result<>();
        PlatMchntListQueryResponse response = new PlatMchntListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, PlatMchntListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (PlatMchntListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("平台商户列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<GroupMchntListQueryResponse> groupMchntListQuery(GroupMchntListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<GroupMchntListQueryResponse> result = new Result<>();
        GroupMchntListQueryResponse response = new GroupMchntListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, GroupMchntListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (GroupMchntListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("集团商户列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntLevelListQueryResponse> mchntLevelListQuery(MchntLevelListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntLevelListQueryResponse> result = new Result<>();
        MchntLevelListQueryResponse response = new MchntLevelListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntLevelListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntLevelListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户等级列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntAreaListQueryResponse> mchntAreaListQuery(MchntAreaListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntAreaListQueryResponse> result = new Result<>();
        MchntAreaListQueryResponse response = new MchntAreaListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntAreaListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntAreaListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户地区列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<UnionRiskMchntQueryResponse> unionRiskMchntQuery(UnionRiskMchntQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<UnionRiskMchntQueryResponse> result = new Result<>();
        UnionRiskMchntQueryResponse response = new UnionRiskMchntQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, UnionRiskMchntQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (UnionRiskMchntQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("风险商户信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<PlatMchntWechatInfoQueryResponse> platMchntWechatInfoQuery(PlatMchntWechatInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<PlatMchntWechatInfoQueryResponse> result = new Result<>();
        PlatMchntWechatInfoQueryResponse response = new PlatMchntWechatInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, PlatMchntWechatInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (PlatMchntWechatInfoQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("平台商户微信进件信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<TermAndQrcodeNumQueryResponse> termAndQrcodeNumQuery(TermAndQrcodeNumQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<TermAndQrcodeNumQueryResponse> result = new Result<>();
        TermAndQrcodeNumQueryResponse response = new TermAndQrcodeNumQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, TermAndQrcodeNumQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (TermAndQrcodeNumQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("平台商户微信进件信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntFeeListQueryResponse> mchntFeeListQuery(MchntFeeListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntFeeListQueryResponse> result = new Result<>();
        MchntFeeListQueryResponse response = new MchntFeeListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntFeeListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntFeeListQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户费率列表查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntTxnAuthQueryResponse> mchntTxnAuthQuery(MchntTxnAuthQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntTxnAuthQueryResponse> result = new Result<>();
        MchntTxnAuthQueryResponse response = new MchntTxnAuthQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntTxnAuthQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntTxnAuthQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户授权交易信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;

    }

    @Override
    public Result<MchntTxnLimitCfgQueryResponse> mchntTxnLimitCfgQuery(MchntTxnLimitCfgQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntTxnLimitCfgQueryResponse> result = new Result<>();
        MchntTxnLimitCfgQueryResponse response = new MchntTxnLimitCfgQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntTxnLimitCfgQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntTxnLimitCfgQueryResponse) dubboResult.getResult();
            result.setResult(response);
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("限额配置查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntStatusInfoListQueryResponse> mcnhtStatusInfoListQuery(MchntStatusInfoListQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntStatusInfoListQueryResponse> result = new Result<>();
        MchntStatusInfoListQueryResponse response = new MchntStatusInfoListQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntStatusInfoListQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntStatusInfoListQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户入驻状态信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntKeyInfoQueryResponse> mchntKeyInfoQuery(MchntKeyInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntKeyInfoQueryResponse> result = new Result<>();
        MchntKeyInfoQueryResponse response = new MchntKeyInfoQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntKeyInfoQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            response = (MchntKeyInfoQueryResponse) dubboResult.getResult();
            response.setRespCode(dubboResult.getRespCode());
            response.setRespDesc(dubboResult.getRespDesc());
            result.setResult(response);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户密钥信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                response.setRespCode(((BizException) e).getCode());
                response.setRespDesc(e.getMessage());
            } else {
                response.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                response.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(response);
        }
        return result;
    }

    @Override
    public Result<MchntBaseQueryResponse> mchntBaseQuery(MchntBaseInfoQueryRequest request) {
        DubboService dubboService = new DubboServiceImpl();
        Result<MchntBaseQueryResponse> result = new Result<>();
        MchntBaseQueryResponse mchntBaseQueryResponse = new MchntBaseQueryResponse();
        try {
            rglog.debug("请求参数:<{}>", JSONObject.toJSONString(request));
            DubboResult dubboResult = dubboService.callBizService(request, MchntBaseQueryResponse.class);
            result.setSuccess(dubboResult.isSuccess());
            mchntBaseQueryResponse = (MchntBaseQueryResponse) dubboResult.getResult();
            result.setResult(mchntBaseQueryResponse);
            mchntBaseQueryResponse.setRespCode(dubboResult.getRespCode());
            mchntBaseQueryResponse.setRespDesc(dubboResult.getRespDesc());
            result.setResult(mchntBaseQueryResponse);
        } catch (Exception e) {
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            e.printStackTrace(new PrintWriter(byteArrayOutputStream, true));
            rglog.error("商户基本信息查询处理失败:<{}>", byteArrayOutputStream.toString());
            result.setSuccess(false);
            if (e instanceof BizException) {
                mchntBaseQueryResponse.setRespCode(((BizException) e).getCode());
                mchntBaseQueryResponse.setRespDesc(e.getMessage());
            } else {
                mchntBaseQueryResponse.setRespCode(RespCodeEnum.SYSTEM_ERROR.getRespCode());
                mchntBaseQueryResponse.setRespDesc(RespCodeEnum.SYSTEM_ERROR.getRespDesc());
            }
            result.setResult(mchntBaseQueryResponse);
        }
        return result;
    }
}
